<!-- 物流线路 - 表单编辑页面 -->
<template>
  <div class="page-container">

    <!-- title -->
    <div class="page-content-title">
      <!--      当前位置：新增保险产品-->
      {{$tt('label_current_position')}}：{{ $tt('物流轨迹查询') }}
    </div>

    <el-form ref="formEl" :model="formValue" label-width="0px" class="common-form-panel-div" style="margin-top: 20px;">

      <el-row>
        <el-col :span="2">
          <!-- 最大投保金额 -->
          <el-form-item >

            <el-input v-model="keyword" style="width: 400px; "></el-input> <el-button @click="queryTrack">查询</el-button>

          </el-form-item>
        </el-col>
      </el-row>

      <el-row v-if="trackDataList && trackDataList.length > 0">
        <el-col :span="3">
          <!-- 保费比例 -->
          <el-form-item >

            <div  style="display: flex;">
              <div style="width: 240px;">跟踪号</div>
              <div>
                <div  style=" flex: 1; display: flex; ">
                  <div style="width: 200px; ">时间</div>
                  <div>跟踪信息</div>
                </div>
              </div>
            </div>

            <div v-for="item,index in trackDataList" style="display: flex;">
              <div style="width: 240px;">{{item.trackNo}}</div>
              <div>
                <div v-for="subItem,subIndex in item.trackList" style=" flex: 1; display: flex; ">
                  <div style="width: 200px; ">{{ $dateFormat(subItem.trackTime) }}</div>
                  <div>
                    {{ subItem.trackDesc }}
                    {{ subItem.trackRemark ?  ' （'+ subItem.trackRemark + '）' : '' }}
                  </div>
                </div>
              </div>

            </div>

          </el-form-item>
        </el-col>
      </el-row>


    </el-form>

  </div>
</template>
<script>

  let moduleName = "物流轨迹查询"

  import router_params from '@/mixin/router_params';
  export default {

    title: moduleName,
    components: {  },
    mixins: [router_params],
    data() {

      return {

        keyword: '',

        trackDataList: [],
        formValue:{}

      };
    },

    created() {

    },

    mounted() {

    },
    methods: {
      init_data_default(into_params) {
        if(into_params.trackNumber){
          this.keyword = into_params.trackNumber
          this.queryTrack()
        }
      },
      queryTrack() {

        let _this = this

        this.$ajax({
          url: '/oms-api/client/OmsOrderTrackClientRpc/track_query.json',
          data: {
            keyword: this.keyword
          },
          success: (response) => {
            this.trackDataList = response.data.rows

            if(!this.trackDataList && this.trackDataList.length == 0){
              _this.$message({
                type: 'error',
                message: '暂无跟踪信息'
              })
            }
          }
        });


      },


    }
  };

</script>
<style>
</style>
